//
//  AudioPlayer.h
//  LO_MUSIC
//
//  Created by lanou3g on 16/2/26.
//  Copyright © 2016年 杨少锋. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol AudioPlayerDelegate <NSObject>
//播放结束执行的通知
-(void)playFinish;
//每0.1次执行一次的协议
//time 当前的时间
-(void)playWithTime:(CGFloat)time;
@end
@interface AudioPlayer : NSObject

//1. 文件是单例
+(instancetype)shareAudioPlayer;
//2. 播放
-(void)playWithUrl:(NSString *)url;

//3. 暂停/恢复
-(void)playOrPause;
//4. 停止
-(void)stop;
//5. 从什么时候开始播放
-(void)seekToWithTime:(CGFloat)time;
//6. 设置音量

//7. 获取音量
@property (nonatomic,assign)CGFloat volume;
//8. 是否正在播放
@property (nonatomic,assign,getter=isPlaying,readonly)BOOL playing;

@property(nonatomic,weak) id <AudioPlayerDelegate>delegate;
@end
